package com.czy.moudle.exception.domain.enums;

/***
 * 异常类型
 *
 * @author 陈致远
 * @date 2016/8/12
 */
public enum Type {
    normal("normal", "普通"),
    web("web", "web请求异常"), //ajax、页面提示
    database("database", "储存与数据库异常"); //数据库记录

    private String content;
    private String name;

    Type(String name, String content){
        this.content = content;
        this.name = name;
    }

    public static Type getByName(String name){
        for(Type type : Type.values()){
            if(type.getName().equals(name)){
                return type;
            }
        }

        return null;
    }

    public String getName() {
        return name;
    }

    public String getContent() {
        return content;
    }
}
